package cn.bdqn.service.impl;

import cn.bdqn.dao.UsersDao;
import cn.bdqn.pojo.Users;
import cn.bdqn.service.UsersService;

public class UsersServiceImpl implements UsersService {


	//注入usersDao 接口
	private UsersDao  usersDao;


	//登录
	public Users doLogin(String userCode, String pwd) {

		Users users = usersDao.getUserByUcode(userCode);
		if(users!=null){//db内是存在此用户
			if(pwd!=null){
				if(users.getPwd().equals(pwd)){
					return  users;
				}
			}

		}

		return null;
	}


	public UsersDao getUsersDao() {
		return usersDao;
	}


	public void setUsersDao(UsersDao usersDao) {
		this.usersDao = usersDao;
	}



}
